<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<head>
<style>
table{
    border-collapse: collapse;
    width: 100%;
}
th,td{
    text-align: left;
    padding: 8px;
}
tr:nth-child(even){background-color: #f2f2f2;}
th{
    background-color: #4CAF50;
}
</style>
</head>
<body>
    <h1>有颜色的表格标题</h1>

<table>
<tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Savings</th>
</tr>
<tr>
    <td>Bill</td>
    <td>Gates</td>
    <td>$100</td>
</tr>
<tr>
    <td>Steve</td>
    <td>Jobs</td>
    <td>$150</td>
</tr>
<tr>
    <td>Elon</td>
    <td>Musk</td>
    <td>$300</td>
</tr>
<tr>
    <td>Mark</td>
    <td>Zuckerberg</td>
    <td>$250</td></tr>
</table>
</body>
</html>